import request from '@/utils/request'

// 查询供应商资质列表
export function listCertificate(query) {
  return request({
    url: '/prod-api/supplier/certificate/list',
    method: 'get',
    params: query
  })
}

// 查询供应商资质详细
export function getCertificate(certificateId) {
  return request({
    url: '/prod-api/supplier/certificate/' + certificateId,
    method: 'get'
  })
}

// 新增供应商资质
export function addCertificate(data) {
  return request({
    url: '/prod-api/supplier/certificate',
    method: 'post',
    data: data
  })
}

// 修改供应商资质
export function updateCertificate(data) {
  return request({
    url: '/prod-api/supplier/certificate',
    method: 'put',
    data: data
  })
}

// 删除供应商资质
export function delCertificate(certificateId) {
  return request({
    url: '/prod-api/supplier/certificate/' + certificateId,
    method: 'delete'
  })
}

// 修改资质状态
export function updateDataStatus(certificateId, dataStatus,supplierUid){
  const data = {
    certificateId,
    dataStatus,
    supplierUid
  }
  return request({
    url: '/prod-api/supplier/certificate/updateDataStatus',
    method: 'put',
    data: data
  })
}

// 修改显示状态
export function updateShowStatus(certificateId, showUser,supplierUid){
  const data = {
    certificateId,
    showUser,
    supplierUid
  }
  return request({
    url: '/prod-api/supplier/certificate/updateShowStatus',
    method: 'put',
    data: data
  })
}
